package java8.stream.demo02buildstream;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.util.stream.Stream;

/**
 * @author ChangLiang
 * @date 2020/4/22
 */
public class AppTest {

    @Test
    @DisplayName("test Stream iterator")
    public void test() {
        Stream<Integer> stream = StreamFactory.createStreamFromIterator();
        stream.forEach(System.out::println);
    }

    @Test
    @DisplayName("test stream generate")
    public void test2(){
        Stream<Double> stream = StreamFactory.createStreamFromGenerate();
        stream.forEach(System.out::println);
    }

    @Test
    @DisplayName("test RandomObjSupplier")
    public void test3() {
        Stream<Obj> stream = StreamFactory.createObjStreamFromGenerate();
        stream.forEach(System.out::println);
    }
}
